<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/pico/aon_timer.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.0.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('aon__timer_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">aon_timer.h</div></div>
</div><!--header-->
<div class="contents">
<a href="aon__timer_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2024 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _PICO_AON_TIMER_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _PICO_AON_TIMER_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &lt;time.h&gt;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#include &quot;<a class="code" href="datetime_8h.html">pico/util/datetime.h</a>&quot;</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#include &quot;hardware/regs/intctrl.h&quot;</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="preprocessor">#ifndef AON_TIMER_IRQ_NUM</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#if HAS_RP2040_RTC</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno">   42</span><span class="preprocessor">#define AON_TIMER_IRQ_NUM() RTC_IRQ</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="preprocessor">#elif HAS_POWMAN_TIMER</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#define AON_TIMER_IRQ_NUM() POWMAN_IRQ_TIMER</span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00047" name="l00047"></a><span class="lineno">   47</span> </div>
<div class="line"><a id="l00048" name="l00048"></a><span class="lineno">   48</span><span class="keyword">typedef</span> void (*aon_timer_alarm_handler_t)(void);</div>
<div class="line"><a id="l00049" name="l00049"></a><span class="lineno">   49</span> </div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga32e4d69ae8c5b2048af84cf706b8b997">aon_timer_start_with_timeofday</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno">   55</span> </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno">   61</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga937223c53432fc9b5fe5252c9712078a">aon_timer_start</a>(<span class="keyword">const</span> <span class="keyword">struct</span> timespec *ts);</div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno">   62</span> </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno">   67</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#gaad98990deb5ce061e3cac6ef7cc69fc5">aon_timer_stop</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno">   68</span> </div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno">   74</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga271d25359d58cd63ca24ec315dd72c4a">aon_timer_set_time</a>(<span class="keyword">const</span> <span class="keyword">struct</span> timespec *ts);</div>
<div class="line"><a id="l00075" name="l00075"></a><span class="lineno">   75</span> </div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno">   81</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga5e61345c450ef3aa217411104ae8f2e3">aon_timer_get_time</a>(<span class="keyword">struct</span> timespec *ts);</div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno">   82</span> </div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga6e17d6adde0e3b25c70c04970116ccb8">aon_timer_get_resolution</a>(<span class="keyword">struct</span> timespec *ts);</div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno">   89</span> </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno">  105</span>aon_timer_alarm_handler_t <a class="code hl_function" href="group__pico__aon__timer.html#ga39dab1da58c2f8178024b233e335d059">aon_timer_enable_alarm</a>(<span class="keyword">const</span> <span class="keyword">struct</span> timespec *ts, aon_timer_alarm_handler_t handler, <span class="keywordtype">bool</span> wakeup_from_low_power);</div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno">  106</span> </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga20cda0289aab2eb5fda914704a1fc2a7">aon_timer_disable_alarm</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno">  112</span> </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno">  118</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__pico__aon__timer.html#ga134ec8ae2a5f2a9b29b9bc4fb6c87493">aon_timer_is_running</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno">  119</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span><span class="keyword">static</span> <span class="keyword">inline</span> uint aon_timer_get_irq_num(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span>    <span class="keywordflow">return</span> AON_TIMER_IRQ_NUM();</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno">  122</span>}</div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span> </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno">  125</span>}</div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno">  126</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno">  127</span> </div>
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno">  128</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="adatetime_8h_html"><div class="ttname"><a href="datetime_8h.html">datetime.h</a></div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga134ec8ae2a5f2a9b29b9bc4fb6c87493"><div class="ttname"><a href="group__pico__aon__timer.html#ga134ec8ae2a5f2a9b29b9bc4fb6c87493">aon_timer_is_running</a></div><div class="ttdeci">bool aon_timer_is_running(void)</div><div class="ttdoc">Disable the currently enabled AON timer alarm if any.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:159</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga20cda0289aab2eb5fda914704a1fc2a7"><div class="ttname"><a href="group__pico__aon__timer.html#ga20cda0289aab2eb5fda914704a1fc2a7">aon_timer_disable_alarm</a></div><div class="ttdeci">void aon_timer_disable_alarm(void)</div><div class="ttdoc">Disable the currently enabled AON timer alarm if any.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:103</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga271d25359d58cd63ca24ec315dd72c4a"><div class="ttname"><a href="group__pico__aon__timer.html#ga271d25359d58cd63ca24ec315dd72c4a">aon_timer_set_time</a></div><div class="ttdeci">void aon_timer_set_time(const struct timespec *ts)</div><div class="ttdoc">Update the current time of the AON timer.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:28</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga32e4d69ae8c5b2048af84cf706b8b997"><div class="ttname"><a href="group__pico__aon__timer.html#ga32e4d69ae8c5b2048af84cf706b8b997">aon_timer_start_with_timeofday</a></div><div class="ttdeci">void aon_timer_start_with_timeofday(void)</div><div class="ttdoc">Start the AON timer running using the result from the gettimeofday() function as the current time.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:114</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga39dab1da58c2f8178024b233e335d059"><div class="ttname"><a href="group__pico__aon__timer.html#ga39dab1da58c2f8178024b233e335d059">aon_timer_enable_alarm</a></div><div class="ttdeci">aon_timer_alarm_handler_t aon_timer_enable_alarm(const struct timespec *ts, aon_timer_alarm_handler_t handler, bool wakeup_from_low_power)</div><div class="ttdoc">Enable an AON timer alarm for a specifed time.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:61</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga5e61345c450ef3aa217411104ae8f2e3"><div class="ttname"><a href="group__pico__aon__timer.html#ga5e61345c450ef3aa217411104ae8f2e3">aon_timer_get_time</a></div><div class="ttdeci">void aon_timer_get_time(struct timespec *ts)</div><div class="ttdoc">Get the current time of the AON timer.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:41</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga6e17d6adde0e3b25c70c04970116ccb8"><div class="ttname"><a href="group__pico__aon__timer.html#ga6e17d6adde0e3b25c70c04970116ccb8">aon_timer_get_resolution</a></div><div class="ttdeci">void aon_timer_get_resolution(struct timespec *ts)</div><div class="ttdoc">Get the resolution of the AON timer.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:147</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_ga937223c53432fc9b5fe5252c9712078a"><div class="ttname"><a href="group__pico__aon__timer.html#ga937223c53432fc9b5fe5252c9712078a">aon_timer_start</a></div><div class="ttdeci">void aon_timer_start(const struct timespec *ts)</div><div class="ttdoc">Start the AON timer running using the specified timespec as the current time.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:123</div></div>
<div class="ttc" id="agroup__pico__aon__timer_html_gaad98990deb5ce061e3cac6ef7cc69fc5"><div class="ttname"><a href="group__pico__aon__timer.html#gaad98990deb5ce061e3cac6ef7cc69fc5">aon_timer_stop</a></div><div class="ttdeci">void aon_timer_stop(void)</div><div class="ttdoc">Stop the AON timer.</div><div class="ttdef"><b>Definition:</b> aon_timer.c:137</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>